package com.uwlaser.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import com.uwlaser.base.CommonModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
* @author zk-Qin
* @date 2022-05-11
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("data_pass_station")
public class DataPassStation extends CommonModel<DataPassStation> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(type= IdType.AUTO)
    private String id;

    @ApiModelProperty(value = "产品SN")
    @NotBlank
    private String productSn;

    @ApiModelProperty(value = "产品型号")
    @NotBlank
    private String productCode;

    @ApiModelProperty(value = "产品类型")
    @NotBlank
    private String productType;

    @ApiModelProperty(value = "订单编号")
    @NotBlank
    private String orderCode;

    @ApiModelProperty(value = "工单编号")
    @NotBlank
    private String workOrderCode;

    @ApiModelProperty(value = "结果")
    private String result;

    @ApiModelProperty(value = "产线编号")
    private String lienCode;

    @ApiModelProperty(value = "工段编号")
    private String sectionCode;

    @ApiModelProperty(value = "工位编号")
    private String stationCode;

    @ApiModelProperty(value = "工序编号")
    private String operationCode;

    @ApiModelProperty(value = "设备编号")
    private String deviceCode;

    @ApiModelProperty(value = "通道编码")
    private String aisleCode;

    @ApiModelProperty(value = "托盘编码")
    private String trayCode;

    @ApiModelProperty(value = "进站时间")
    private Date entryTime;

    @ApiModelProperty(value = "出站时间")
    private Date exitTime;

    @ApiModelProperty(value = "加工模式")
    private String processedMode;

    @ApiModelProperty(value = "返修次数")
    private Integer repairNum;

    @ApiModelProperty(value = "缺陷代码")
    private String flawCode;


    @ApiModelProperty(value = "创建人")
    @TableField(fill= FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateBy;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "班次编码")
    private String shiftCode;

    @ApiModelProperty(value = "班组id")
    private Integer teamGroupId;

    public void copyFrom(DataPassStation source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
